<!DOCTYPE html>
<html lang="en" xmlns:zxw="http://www.w3school.com.cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>首页</title>
    <link rel="stylesheet" href="../../../js/common/layui/css/layui.css">
    <link rel="stylesheet" href="../../../css/common/animate.css"/>
    <link rel="stylesheet" href="../../../css/common/common.css"/>
    <style type="text/css">
        .layui-table-cell {
            height: 60px !important;
            line-height: 60px !important;
        }
    </style>
</head>
<body class="layout-zxw zxw-body">
<div class="layui-form">
    <form action="" class="zxw-search">
        <div class="layui-form-item">
            <zxw:input id="original_file_name" name="original_file_name" inline="true" placeholder="请输入原始文件名"
                       parcel="true" parcelName="用户名"></zxw:input>
            <div class="layui-inline">
                <zxw:bnt type="query" tableid="textTable" title="查询"></zxw:bnt>
                <!--<zxw:bnt type="add" url="../html/sys/resouce/add.html" title="新增文件" ></zxw:bnt>-->
            </div>
        </div>
    </form>
    <hr/>
    <div class="zxw-list">
        <div class="zxw-table-tool" id="zxw-table-tool">
            <zxw:bnt type="delete" msg="确定批量删除吗?此操作为不可逆，请谨慎。" class="layui-btn-sm" ico="" url="URL.FILE.DELETE"
                     title="批量删除"></zxw:bnt>
        </div>
        <zxw:table cellMinWidth="10" class="zxw_table layui-table layui-hide" page="true" loading="true"
                   url="URL.FILE.GETLIST" id="textTable">
            <zxw:thead class="zxw_head">
                <zxw:tr class="zxw_tr">
                    <zxw:th class="zxw_th" style="height:60px" type="checkbox" fixed="left"></zxw:th>
                    <zxw:th fixed="left" minWidth="50" class="">
                        <zxw:handle fun="preview" title="预览" name="query" warnTitle="确定删除吗？?此操作为不可逆，请谨慎。"
                                    class="layui-btn-danger"></zxw:handle>
                    </zxw:th>
                    <zxw:th class="zxw_th" style="height:60px;text-align: center;" field="head_img" title="预览">
                        {{# if(d.type == 'video/mp4'){ }}
                        <img class="showVide" url="{{ d.path }}" style="width: 60px;height: 60px;"
                             src="/img/video.jpeg"/>
                        {{# }else if(d.type == 'image/jpeg'){ }}
                        <img class="showImg" style="width: 60px;height: 60px;" src="{{ d.path }}"/>
                        {{# }else if(d.type == 'image/png'){ }}
                        <img class="showImg" style="width: 60px;height: 60px;" src="{{ d.path }}"/>
                        {{# }else if(d.type == 'audio/mp3'){ }}
                        <img class="showAudio" url="{{ d.path }}" style="width: 60px;height: 60px;"
                             src="/img/audio.jpeg"/>
                        {{# } }}
                    </zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="original_file_name" sort="true"
                            title="原始文件名"></zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="size" sort="true" title="大小(单位b)">
                        {{ d.size }}b ≈ {{new Number(d.size/1024/1024).toFixed(2)}}M
                    </zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="path" sort="true" title="访问路径"></zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="type" sort="true" title="类型"></zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="oper_name" sort="true" title="操作人"></zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="oper_type" sort="true" title="操作人类型">
                        {{#if(d.oper_type == 1){}}
                        后台管理
                        {{#}else if(d.oper_type == 2){}}
                        前端人员
                        {{#}}}
                    </zxw:th>
                    <zxw:th class="zxw_th" style="height:60px" field="oper_date" sort="true" title="上传时间"></zxw:th>

                </zxw:tr>
            </zxw:thead>
        </zxw:table>
    </div>
</div>
<script type="application/javascript" src="../../../js/common/own/own.js?layui,jquery,njzxw,URL">
    njzxw.layui.init();

    function preview(obj) {
        $(obj.tr).find("img").click();
    }

</script>
</body>
</html>